@import "variables";

.header {
  width: 100%;
  padding: 10px 0;
  background-color: $header-bg;

  .pure-g {
    @media (min-width: 768px) {
      width: 100%;
      margin: auto;
    }

    @media (min-width: 1160px) {
      width: 1160px;
    }
  }

  .header-logo,
  .header-menu,
  .pure-form {
    float: left;
  }

  .pure-form {
    vertical-align: middle;
    position: relative;
    font-size: 12px;
    line-height: 30px;
    padding: 15px 10px;

    input {
      height: 30px;
      margin: 0;
      border-radius: 2px;
      padding-right: 35px;
      font-weight: lighter;
      background-color: $search-input-bg;
      border: 1px solid $search-input-border;

      &:focus {
        background-color: $search-input-bg-focus;
        border: 1px solid $search-input-border-focus;
      }
    }

    button {
      position: absolute;
      top: 15px;
      right: 10px;
      height: 30px;
      width: 30px;
      padding: 8px;
      margin: 0;
      color: $header-search-btn;
      background: none;

      &:hover,
      &:focus {
        color: $header-link-active-color;
      }
    }
  }

  .pure-menu-link {
    padding: 0;
    color: $header-link-color;

    &.active,
    &:hover,
    &:focus {
      color: $header-link-active-color;
      background-color: transparent;
    }
  }

  .header-menu .pure-menu-link {
    font-weight: lighter;
  }

  .pure-menu-heading {
    padding-left: 30px;
    height: 30px;
    font-size: 12px;
    line-height: 30px;
    background: transparent image-url("users/logo.png") left center no-repeat;
    background-size: contain;
  }
}

@media (max-width: 767px) {
  .topbar {
    height: 60px;
    padding: 15px 15px 15px 20px;
    background-color: $header-bg;
    .pure-menu-heading {
      float: left;
      padding-left: 30px;
      height: 30px;
      font-size: 12px;
      color: $header-link-color;
      line-height: 20px;
      background: transparent image-url("users/logo.png") left center no-repeat;
      background-size: contain;
    }

    .custom-toggle {
      float: right;
      width: 30px;
      height: 30px;
      padding: 5px;

      .bar {
        display: block;
        width: 100%;
        height: 3px;
        background-color: $white;
        border-radius: 2px;
        margin: 3px 0 4px;
        transition: width 0.5s;

      }
      &.active {
        .bar:nth-child(2) {
          width: 80%;
        }
        .bar:last-child {
          width: 60%;
        }
      }
    }
  }

  .header {
    position: fixed;
    top: 0;
    left: -66.88%;
    width: 66.875%;
    height: 100%;
    background-color: $light-tundora;
    z-index: 9999;
    border-right: 1px solid $emperor;
    transition: left 0.5s;

    &.open {
      left: 0;
    }

    .pure-menu {
      padding: 0;
    }

    .header-logo {
      padding-top: 5px;
      padding-bottom: 15px;
      text-align: center;
    }

    .pure-menu-list {
      position: relative;
      top: 70px;
      padding: 0;

      .pure-menu-item {
        width: 100%;
        height: 60px;
        text-align: center;
        border-top: 1px solid $emperor;
        display: block;
        line-height: 60px;

        &:last-child {
          border-bottom: 1px solid $emperor;
        }

      }
    }

    .pure-menu-link:hover,
    .pure-menu-link:focus,
    .pure-menu-link.active {
      color: $white;
      background-color: $mine-shaft;
    }

    .pure-form {
      position: relative;
      top: -180px;
      padding: 20px 18px;

      button {
        top: 20px;
        right: 18px;
      }
    }

    .header-user {
      display: none;
    }
  }
}

@media (min-width: 768px) {
  .topbar {
    display: none;
  }

  .header {
    height: 80px;
    padding: 10px 0;
    line-height: 40px;

    .header-logo {
      width: auto;
      padding-left: 20px;
    }

    .pure-menu-heading {
      padding-left: 40px;
      height: 40px;
      line-height: 40px;
      font-size: 15.3px;
    }

    .pure-menu {
      display: block;
    }

    .header-menu {
      text-align: center;
    }

    .header-user {
      float: right;
      padding-right: 20px;
      text-align: right;
    }

    .pure-menu-item + .pure-menu-item {
      margin-left: 20px;
    }

    .pure-menu-has-children > .pure-menu-link::after {
      content: none;
    }

    .pure-menu-children {
      top: 40px;
      left: auto;
      right: 0;
      width: 110px;
      padding-top: 19px;
      margin-right: -20px;
      background-color: $header-bg;

      &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        margin-left: -5px;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 10px solid transparent;
        border-bottom: 10px solid $header-sub-menu-bg;
      }
      .pure-menu-item {
        margin-left: 0;
        text-align: center;
        background-color: $header-sub-menu-bg;

        &:hover {
          .pure-menu-link {
            color: $header-link-color;
          }
          background-color: $header-sub-menu-bg-active;
        }
      }
    }
  }
}

@media (min-width: 1024px) {
  .header {
    .pure-menu-heading {
      font-size: 19px;
    }
  }
}

@media (min-width: 1160px) {
  .header {
    .header-logo {
      padding-left: 10px;
    }

    .header-user {
      padding-right: 10px;
    }
  }
}
